﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ViewRidgeAssistant
{
    public partial class trans_select : Form
    {

        public data_source _data_module;
        public String _trans_action;

        public trans_select()
        {
            InitializeComponent();
        }

        public trans_select(data_source data_module)
        {
            InitializeComponent();
            this._data_module = data_module;
        }

        private void b_cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        //Оформление покупки картины
        private void b_create_work_buying_Click(object sender, EventArgs e)
        {
            this._trans_action = "sale";
            this.create_transaction();
        }

        //Оформление продажи картины
        private void b_create_work_selling_Click(object sender, EventArgs e)
        {
            this._trans_action = "purchase";
            this.create_transaction();
        }

        private void create_transaction()
        {
            form_transaction trans = new form_transaction(this._data_module, null, this._trans_action);
            trans.ShowDialog();
            trans.Dispose();
            this.Close();
        }

    }
}
